using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Versions
{
    /// <summary>
    /// <para>Reconcile Version</para>
    /// <para>Reconciles a version against another version in its lineage.</para>
    /// <para>将一个版本与其沿袭中的另一个版本进行协调。</para>
    /// </summary>    
    [DisplayName("Reconcile Version")]
    public class ReconcileVersion : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ReconcileVersion()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para>The ArcSDE geodatabase containing the reconcilable version.</para>
        /// <para>包含可协调版本的 ArcSDE 地理数据库。</para>
        /// </param>
        /// <param name="_version_name">
        /// <para>Version Name</para>
        /// <para>Name of the Edit Version to be reconciled with the Target Version.</para>
        /// <para>要与目标版本协调的编辑版本的名称。</para>
        /// </param>
        /// <param name="_target_name">
        /// <para>Target Version</para>
        /// <para>Name of any version in the direct ancestry of the Edit version, such as the parent version or the default version.</para>
        /// <para>编辑版本的直接祖先中的任何版本的名称，例如父版本或默认版本。</para>
        /// </param>
        public ReconcileVersion(object _in_workspace, object _version_name, object _target_name)
        {
            this._in_workspace = _in_workspace;
            this._version_name = _version_name;
            this._target_name = _target_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Reconcile Version";

        public override string CallName => "management.ReconcileVersion";

        public override List<string> AcceptEnvironments => ["configKeyword", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_workspace, _version_name, _target_name, _conflict_definition.GetGPValue(), _conflict_resolution.GetGPValue(), _aquired_locks.GetGPValue(), _abort_if_conflicts.GetGPValue(), _post.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>The ArcSDE geodatabase containing the reconcilable version.</para>
        /// <para>包含可协调版本的 ArcSDE 地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Version Name</para>
        /// <para>Name of the Edit Version to be reconciled with the Target Version.</para>
        /// <para>要与目标版本协调的编辑版本的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _version_name { get; set; }


        /// <summary>
        /// <para>Target Version</para>
        /// <para>Name of any version in the direct ancestry of the Edit version, such as the parent version or the default version.</para>
        /// <para>编辑版本的直接祖先中的任何版本的名称，例如父版本或默认版本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Version")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _target_name { get; set; }


        /// <summary>
        /// <para>Conflict Definition</para>
        /// <para><xdoc>
        ///   <para>Describes the conditions required for a conflict to occur:</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Any changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Only changes to the same attribute of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to different attributes will not be considered a conflict during reconcile.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>描述发生冲突所需的条件：</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 在协调期间，对父版本和子版本中同一行或要素的任何更改都将发生冲突。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 在协调过程中，只有对父版本和子版本中同一行或要素的相同属性所做的更改才会被标记为冲突。在协调过程中，对不同属性的更改不会被视为冲突。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _conflict_definition_value _conflict_definition { get; set; } = _conflict_definition_value._BY_OBJECT;

        public enum _conflict_definition_value
        {
            /// <summary>
            /// <para>BY_OBJECT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BY_OBJECT")]
            [GPEnumValue("BY_OBJECT")]
            _BY_OBJECT,

            /// <summary>
            /// <para>BY_ATTRIBUTE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("BY_ATTRIBUTE")]
            [GPEnumValue("BY_ATTRIBUTE")]
            _BY_ATTRIBUTE,

        }

        /// <summary>
        /// <para>Conflict Resolution</para>
        /// <para><xdoc>
        ///   <para>Describes the behavior if a conflict is detected:</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—For all conflicts, resolves in favor of the target version. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—For all conflicts, resolves in favor of the edit version.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>描述检测到冲突时的行为：</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 对于所有冲突，以支持目标版本进行解析。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 对于所有冲突，将解析为支持编辑版本。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Resolution")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _conflict_resolution_value _conflict_resolution { get; set; } = _conflict_resolution_value._FAVOR_TARGET_VERSION;

        public enum _conflict_resolution_value
        {
            /// <summary>
            /// <para>FAVOR_TARGET_VERSION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FAVOR_TARGET_VERSION")]
            [GPEnumValue("FAVOR_TARGET_VERSION")]
            _FAVOR_TARGET_VERSION,

            /// <summary>
            /// <para>FAVOR_EDIT_VERSION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FAVOR_EDIT_VERSION")]
            [GPEnumValue("FAVOR_EDIT_VERSION")]
            _FAVOR_EDIT_VERSION,

        }

        /// <summary>
        /// <para>Acquire locks during reconcile</para>
        /// <para><xdoc>
        ///   <para>Determines whether feature locks will be acquired.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Acquires locks when there is no intention of posting the edit session. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—No locks are acquired and the edit session will be posted to the target version.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定是否获取功能锁。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 在无意发布编辑会话时获取锁定。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 未获取任何锁，编辑会话将发布到目标版本。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Acquire locks during reconcile")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _aquired_locks_value _aquired_locks { get; set; } = _aquired_locks_value._true;

        public enum _aquired_locks_value
        {
            /// <summary>
            /// <para>LOCK_ACQUIRED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("LOCK_ACQUIRED")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_LOCK_ACQUIRED</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_LOCK_ACQUIRED")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Abort if conflicts</para>
        /// <para><xdoc>
        ///   <para>Determines if the reconcile process should be aborted if conflicts are found between the target version and the edit version.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Aborts the reconcile if conflicts are found.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Does not abort the reconcile if conflicts are found. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定如果发现目标版本与编辑版本之间存在冲突，是否应中止协调过程。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 如果发现冲突，则中止协调。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果发现冲突，则不中止协调。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Abort if conflicts")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _abort_if_conflicts_value _abort_if_conflicts { get; set; } = _abort_if_conflicts_value._false;

        public enum _abort_if_conflicts_value
        {
            /// <summary>
            /// <para>ABORT_CONFLICTS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABORT_CONFLICTS")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ABORT</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ABORT")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Post version after reconcile</para>
        /// <para><xdoc>
        ///   <para>Posts the current edit session to the reconciled target version.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Current edits will be posted to the target version after the reconcile.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Current edits will not be posted to the target version after the reconcile. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将当前编辑会话发布到协调的目标版本。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 当前编辑将在协调后发布到目标版本。</bullet_item><para/>
        ///     <bullet_item>未选中 - 协调后，当前编辑内容将不会发布到目标版本。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Post version after reconcile")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _post_value _post { get; set; } = _post_value._false;

        public enum _post_value
        {
            /// <summary>
            /// <para>POST</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("POST")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_POST</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_POST")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public ReconcileVersion SetEnv(object configKeyword = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(configKeyword: configKeyword, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}